<?php

namespace app\admin\controller;
use app\base\controller\Base;
use think\Request;
use think\Cache;
use think\Config;
use think\Session;

/**
 * Class Pcsite
 * @package app\admin\controller  PCsite配置
 */
class Help extends Base
{
    public  $model;

    public function __construct()
    {
   $this->model = model("Help");
        parent::__construct();
    }


    /**
     *  pC具体设置
     *
     * @return \think\Response
     */
    public function index()
    {//
        $where = [];
        //时间的处理
        $res =   $this->model->AdminPageNoAgent($where);
        if(empty($res)){
            return failJson("暂无记录");
        }
        return   resJson(1,$this->ecLang("query"),$res['res'],$res['pageInfo']);
    }


    /**
     *  添加配置信息
     */
    public function save(){
        $data = $this->RealData;

       if(empty($data)){
           return failJson("数据不能为空");
       }

        $res = $this->model->save($data);
        if(empty($res)){
            return failJson("添加信息失敗");
        }
        return sucessJson("添加信息成功");
    }

    /**
     *  添加配置信息
     */
    public function up(){

        $data = $this->RealData;

        $res = $this->model->save($data,['id'=>$this->RealData['id']]);
        if(empty($res)){
            return failJson("修改前台信息失敗");
        }
        return sucessJson("修改前台信息成功");
    }



}
